<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<f:view>
	<h:form>
		<h:dataTable value="#{userPageController.users}" var="user">
			<h:column>
				<f:facet name="header">
					<h:column>
						<h:outputText value="Name" />
					</h:column>
				</f:facet>
				<h:outputText value="#{user.name}" />
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:column>
						<h:outputText value="Email" />
					</h:column>
				</f:facet>
				<h:outputText value="#{user.email}" />
			</h:column>
		</h:dataTable>
		<h:commandButton action="#{userPageController.addUser}"
			value="Add User" />
	</h:form>
	<h:form rendered="#{userPageController.user != null}">
		<h:panelGrid columns="2">
			<h:outputLabel value="User Name" for="userName" />
			<h:inputText id="userName" value="#{userPageController.user.name}" />
			<h:outputLabel value="User Email" for="userEmail" />
			<h:inputText id="userEmail" value="#{userPageController.user.email}" />
			<h:commandButton action="#{userPageController.save}" value="Save" />
		</h:panelGrid>
	</h:form>
</f:view>
</body>
</html>